package com.diver.flinkdemo.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.diver.flinkdemo.entity.xxt.LastLocation;

import java.util.List;
import java.util.Map;

public interface ILastLocationService {
    /**
     * 保存最新位置
     *
     * @param lastLocation
     * @return
     */
    void saveLastLocation(LastLocation lastLocation);

    /**
     * 保存驻网状态
     * @param studentCardId
     * @param networkStatus
     */
    void saveNetworkStatus(String studentCardId, String networkStatus);

    /**
     * 查询某时段内某学校设备的最新位置
     * @param schoolIds
     * @param startTime
     * @param endTime
     * @return
     */
    List<LastLocation> queryLastLocation(List<String> schoolIds, Long startTime, Long endTime);

    /**
     * 查询某时段内某些设备的最新上报时间
     * @param startTime
     * @param endTime
     * @param studentCardIdList
     * @return
     */
    List<LastLocation> getLatestInTimes(Long startTime,Long endTime, List<String> studentCardIdList);

    /**
     * 根据上报时间段和学生信息查询该时间段内最后上报定位数据的学生定位信息
     * @param startTime
     * @param endTime
     * @param studentCardIdList
     * @return
     */
    List<Map<String, Object>> getLastLocationList(Long startTime, Long endTime, List<String> studentCardIdList);

    LastLocation getOneByParams(QueryWrapper<LastLocation> wrapper);
}
